package com.as.server.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName comment
 */
@Data
public class Comment implements Serializable {
    /**
     * 
     */
    private Long cid;

    /**
     * 
     */
    private Long parentId;

    /**
     * 
     */
    private Long userId;

    /**
     * 
     */
    private String commentDetails;

    /**
     * 
     */
    private Date commentDate;

    /**
     * （1：作者，2：普通用户）
     */
    private Integer contentFlag;

    /**
     * 
     */
    private Long aid;

    /**
     * 
     */
    private Long replyCommentId;

    /**
     * 
     */
    private Long replyUserId;

    /**
     * 
     */
    private String userName;

    /**
     * 
     */
    private String replyUserName;

    /**
     * 
     */
    private Long goods;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Comment other = (Comment) that;
        return (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
            && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCommentDetails() == null ? other.getCommentDetails() == null : this.getCommentDetails().equals(other.getCommentDetails()))
            && (this.getCommentDate() == null ? other.getCommentDate() == null : this.getCommentDate().equals(other.getCommentDate()))
            && (this.getContentFlag() == null ? other.getContentFlag() == null : this.getContentFlag().equals(other.getContentFlag()))
            && (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid()))
            && (this.getReplyCommentId() == null ? other.getReplyCommentId() == null : this.getReplyCommentId().equals(other.getReplyCommentId()))
            && (this.getReplyUserId() == null ? other.getReplyUserId() == null : this.getReplyUserId().equals(other.getReplyUserId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getReplyUserName() == null ? other.getReplyUserName() == null : this.getReplyUserName().equals(other.getReplyUserName()))
            && (this.getGoods() == null ? other.getGoods() == null : this.getGoods().equals(other.getGoods()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCommentDetails() == null) ? 0 : getCommentDetails().hashCode());
        result = prime * result + ((getCommentDate() == null) ? 0 : getCommentDate().hashCode());
        result = prime * result + ((getContentFlag() == null) ? 0 : getContentFlag().hashCode());
        result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode());
        result = prime * result + ((getReplyCommentId() == null) ? 0 : getReplyCommentId().hashCode());
        result = prime * result + ((getReplyUserId() == null) ? 0 : getReplyUserId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getReplyUserName() == null) ? 0 : getReplyUserName().hashCode());
        result = prime * result + ((getGoods() == null) ? 0 : getGoods().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cid=").append(cid);
        sb.append(", parentId=").append(parentId);
        sb.append(", userId=").append(userId);
        sb.append(", commentDetails=").append(commentDetails);
        sb.append(", commentDate=").append(commentDate);
        sb.append(", contentFlag=").append(contentFlag);
        sb.append(", aid=").append(aid);
        sb.append(", replyCommentId=").append(replyCommentId);
        sb.append(", replyUserId=").append(replyUserId);
        sb.append(", userName=").append(userName);
        sb.append(", replyUserName=").append(replyUserName);
        sb.append(", goods=").append(goods);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}